const express = require('express')

const app = express()

// app.use(express.static('public'))
// app.use(express.static('files'))

// app.use(express.static('public'))
//加上前缀
app.use('/news', express.static('public'))
app.use(express.static('files'))

app.get('/', (req, res) => {
    res.send({
        name: 'home',
        msg: 'express 入门'
    })
})

app.listen(8000, () => {
    console.log('8000 running')
})